package com.zjitc.service.imp;

import com.zjitc.dao.CartDao;
import com.zjitc.model.CartItem;
import com.zjitc.model.Product;
import com.zjitc.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/5/30 14:34
 * @description:
 */
@Service
public class CartServiceImp implements CartService {
    @Autowired
    private CartDao cartDao;
    @Override
    public Product findcartPid(Integer pid) {
        return cartDao.findcartPid(pid);
    }

    @Override
    public List<CartItem> listCartItem(Integer uid) {
        return cartDao.listCartItem(uid);
    }

    @Override
    public void addCart(CartItem cart) {
         cartDao.addCart(cart);
    }

    @Override
    public List<CartItem> listCart() {
      return  cartDao.listCart();
    }

  @Override
  public void remover(Integer pid) {
     cartDao.remover(pid);
  }

  @Override
  public void delete() {
     cartDao.delete();
  }
}
